As digital cameras rapidly prevail in the market in recent years, the role of a photographing device is shifting from conventional cameras using color films to digital cameras. One of reasons for this trend is that the digital camera comprises a function of performing digital development processing including a plurality of image processes for an image signal photographed by an image sensor, displaying the image on an accessory image display such as a TFT monitor immediately after photographing, and allowing the user to observe the photographing result quickly. An example of such a digital camera is disclosed in, e.g., Japanese Patent Laid-Open No. 2003-134530.
In the film camera, characteristics such as sensitivity, white balance, and color development are determined by a film loaded in the camera. To the contrary, the digital camera can easily change color development of a photographed image and the like by changing the parameter settings of image processes.
FIG. 3 is a block diagram showing an example of the arrangement of a conventional digital camera having a plurality of color filters.
These color filters are primary color filters having an array of R (Red), Gr1 (Green 1), Gr2 (Green 2), and B (Blue), as shown in FIG. 21. By defining Gr on the R line as Gr1 and Gr on the B line as Gr2, Gr1 and Gr2 are regarded as different chrominance components in consideration of a case in which read amplifiers having different circuit arrangements are used.
A white balance adjustment unit 320 executes white balance adjustment processing for respective chrominance component data 304 of a digital chrominance signal which is photographed by an image sensor 301 having color filters of this array and A/D-converted by an A/D converter 303.
In this case, white balance control values for white balance processing are given as parameters of respective chrominance components. These control values are multiplied for pixels of each chrominance component and set so that the ratio of the magnitudes of chrominance signal components at the achromatic part of an image becomes R:Gr1:Gr2: B=1:1:1:1.
In auto white balance adjustment in which a white balance control value suitable for a photographed image is automatically obtained from photographed image data, for example, the following method is adopted.
The R:B ratio and (R+B):(Gr1+Gr2) ratio are calculated from adjacent R, Gr1, Gr2, and B in image data, and plotted as represented by ★s 2103 on the two-dimensional coordinate system, as shown in FIG. 19. A combination of R, Gr1, Gr2, and B falling within a coordinate range 2101 around a locus line 2102 called a black body radiation locus or CIE day light locus is defined as an achromatic region. Integral values SumR, SumGr1, SumGr2, and SumB of the respective chrominance components in the region are calculated to obtain the SumR:SumGr1:SumGr2:SumB ratio. White balance control values WbR, WbGr1, WbGr2, and WbB with which the ratio becomes 1:1:1:1 are calculated byWbR=(SumGr1+SumGr2)/(2×R)  (1)WbGr1=(SumGr1+SumGr2)/(2×Gr1)  (2)WbGr2 =(SumGr1+SumGr2)/(2×Gr2)  (3)WbB=(SumGr1+SumGr2)/(2×B)  (4)
In auto white balance adjustment, the white balance control values are determined for a color temperature of the light source that is optimal for the target image. White balance adjustment processing is done by multiplying image data of pixels of R filters by WbR, those of pixels of Gr1 filters by WbGr1, those of pixels of Gr2 filters by WbGr2, and those of pixels of B filters by WbB.
In addition to auto white balance adjustment, there are proposed preset white balance adjustment and manual white balance adjustment. In preset white balance adjustment, white balance adjustment processing is done by giving control values WbR, WbGr1, WbGr2, and WbB which are constant with respect to the color temperature of a predetermined light source. In manual white balance adjustment, an achromatic object is photographed in advance under the same light source as that used for photographing, and the white balance control values WbR, WbGr1, WbGr2, and WbB are calculated from R, Gr1, Gr2, and B data of the photographed image.
A level correction unit 322 uniquely gives, regardless of pixels, the same gain value as a parameter to the respective chrominance components of the image signal having undergone white balance processing. The respective signal components are multiplied by the gain value, thereby correcting the signal level.
A low-pass filtering unit 324 performs low-pass filtering processing for the level-corrected image signal.
The image signal is decomposed into four two-dimensional planes of R, Gr1, Gr2, and B for pixels corresponding to the respective color filters. On the plane of each color, “0”s are assigned and inserted into pixels at pixel array positions at which no color filter of the color is assigned, as shown in FIG. 22. Each two-dimensional plane undergoes filtering.
A matrix processing unit 326 executes, for a signal 325 output from the low-pass filtering unit 324, matrix operation of replacing each chrominance signal component with another chrominance signal component. For example, operation of converting (R, Gr1, Gr2, B) signal components into (Y, Cr, Cb) signal components of a luminance signal Y and chrominance signals Cr and Cb is achieved by 4×3 matrix transformation:
                              (                                                    Y                                                                                      C                  r                                                                                                      C                  b                                                              )                =                              (                                                                                m                    ⁢                                                                                  ⁢                    11                                                                                        m                    ⁢                                                                                  ⁢                    12                                                                                        m                    ⁢                                                                                  ⁢                    13                                                                                        m                    ⁢                                                                                  ⁢                    14                                                                                                                    m                    ⁢                                                                                  ⁢                    21                                                                                        m                    ⁢                                                                                  ⁢                    22                                                                                        m                    ⁢                                                                                  ⁢                    23                                                                                        m                    ⁢                                                                                  ⁢                    24                                                                                                                    m                    ⁢                                                                                  ⁢                    31                                                                                        m                    ⁢                                                                                  ⁢                    32                                                                                        m                    ⁢                                                                                  ⁢                    33                                                                                        m                    ⁢                                                                                  ⁢                    34                                                                        )                    ⁢                      (                                                            R                                                                                                  Gr                    ⁢                                                                                  ⁢                    1                                                                                                                    Gr                    ⁢                                                                                  ⁢                    2                                                                                                B                                                      )                                              (        A        )            
The image signal transformed into (Y, Cr, Cb) signal components undergoes contrast control processing 328 on the basis of a gamma table. For example, a characteristic table which converts a 10-bit input image signal into an 8-bit image signal, as shown in FIG. 7, is supplied as a parameter to control the tone and contrast of the image.
Of image data 329 whose contrast is controlled on the basis of the gamma table, the Cr and Cb signals are sent to a color gain correction unit 330 which performs color processing, whereas the Y signal is sent to an edge enhancement unit 333 which performs luminance signal processing.
Of the (Y, Cr, Cb) signal components separated into the luminance and chrominance signal components, the chrominance signal components Cr and Cb undergo color gain correction processing by the color gain correction unit 330. At this time, a color gain correction value is used as a parameter, and the Cr and Cb values are multiplied by this gain to adjust the color density. This color gain correction applies the gain on the Cr-Cb coordinate system, and the color saturation can be adjusted.
A hue matrix transformation unit 332 executes 2×2 matrix operation for the chrominance signal components Cr and Cb to adjust the hue. In this case, a 2×2 matrix is given as a parameter, and the hue angle is converted by coordinate transformation on the (Cr,Cb) two-dimensional coordinate system:
                              (                                                                      Cr                  ′                                                                                                      Cb                  ′                                                              )                =                              (                                                                                c                    ⁢                                                                                  ⁢                    11                                                                                        c                    ⁢                                                                                  ⁢                    12                                                                                                                    c                    ⁢                                                                                  ⁢                    21                                                                                        c                    ⁢                                                                                  ⁢                    22                                                                        )                    ⁢                      (                                                            Cr                                                                              Cb                                                      )                                              (        B        )            
The luminance signal component Y undergoes edge enhancement processing by the edge enhancement unit 333. Parameters in the edge enhancement unit 333 include the number of adjacent pixels to be referred to for a pixel subjected to edge enhancement, the gain value of edge enhancement, and an offset value as the threshold level used to detect an edge to be enhanced.
For example, assuming that reference pixels in edge enhancement are eight pixels (a1 to a8) around a target pixel P whose edge is to be enhanced as shown in FIG. 20, the mean value S of the nine pixels including the target pixel P is calculated:
  S  =            (              P        +                              ∑                          k              =              1                        8                    ⁢                                          ⁢          ak                    )        /    9  
The difference between the target pixel and the mean value S is calculated, and when the difference exceeds the offset value th, the difference is multiplied by the gain value Gain of edge enhancement and the product is added to the original target pixel P, thereby achieving edge enhancement processing:P′=P+(P−S−th)·Gain ((P−S)≧th)
With these parameters, the degree of edge enhancement processing on the image is adjusted. Edge enhancement can be made strong by a larger gain value and weak by a smaller gain value. Edge enhancement can be made weak by a larger offset value and strong by a smaller gain value.
The image signal (Y, Cr, Cb) having undergone digital development processing including various image processes is formatted by a formatting unit 309 into an image file of a general-purpose image format such as a JPEG file. The image file is recorded by an image recording unit 317 on various recording media (e.g., compact flash® memory card) removable from the camera main body.
From the above description, image processing which reflects the intention of the user of the digital camera on various photographing conditions can be realized by setting before photographing the parameters of various image processes when digital development processing is executed for a photographed image. If, however, an image of an image quality which does not reflect the intention of the photographer is photographed due to a change in photographing conditions during photographing, parameters must be set again to execute photographing again. Also, whether set parameters are optimal is not known until a photographed image is confirmed, and photographing may be repeated, missing a photographing scene intended by the photographer.